#ifndef BYIDMATCHER_H_
#define BYIDMATCHER_H_

#ifndef NULL
#define NULL 0
#endif

#include "Matcher.h"

/*
 * Matcher que utiliza el metodo getId() para comparar.
 */
template<class I> class ByIdMatcher: public Matcher<I> {
public:

	ByIdMatcher() {
	}

	ByIdMatcher(I current) {
		this->current = current;
	}

	virtual ~ByIdMatcher() {
	}

	virtual bool matches(I dataToCompare) {
		return ((this->current != NULL) && (dataToCompare != NULL)
				&& (this->current->getId() == dataToCompare->getId()));
	}

	virtual ByIdMatcher* setCurrent(I current) {
		this->current = current;
		return this;
	}

private:
	I current;
};

#endif /* BYIDMATCHER_H_ */
